<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ page import="com.bosch.in.rtp1.ept.constant.FXFactorConstant;"%>
<link href="css/modifiedJUI.css" type="text/css" rel="stylesheet"></link>
<script type="text/javascript" src="js/jqgridUtility.js"></script>
<script type="text/javascript" src="js/fxFactor.js"></script>
<script type="text/javascript" src="js/json2.js"></script>
<form name="searchForm" action="loadFxFactors.do?cmd=loadFxFactors" method="POST">

<div id="filterHeader" class="ui-jqgrid ui-widget ui-corner-all">
	<div class = "ui-jqgrid-view">
		<div class="ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix">
			<a id="minFilterButton" class="ui-jqgrid-titlebar-close HeaderButton" href="javascript:void(0)" style="right: 0px;">
				<span id="minButton" class="ui-icon ui-icon-circle-triangle-n"></span>
			</a>
				<span class="ui-jqgrid-title">Filter Criteria</span>
		</div>
	</div>
</div>
<table id="filterCriteria" width="100%" border="0" class="box" id="search_box">
	<tbody>
		<tr>
				<td width="200px" nowrap="nowrap"> 
					<span style="display:inline-block;font-size: 11px;">Year</span>
					<span style="display:inline-block;font-size: 11px;margin: 5px;">:</span>
					<html:select  name="fxCriteria" property="selectedYear" styleClass="DropDownTextBox" style="width:120px">
						<html:optionsCollection name="fxCriteria" property="years" value="value" label="value"/>
					</html:select>
				</td>	
				<td width="200px" nowrap="nowrap"> 
					<span style="display:inline-block;font-size: 11px;">Priority</span>
					<span style="display:inline-block;font-size: 11px;margin: 5px;">:</span>
					<html:select  name="fxCriteria" property="selectedPriority" styleClass="DropDownTextBox" style="width:120px">
						<html:optionsCollection name="fxCriteria" property="priorities" value="value" label="value"/>
					</html:select>
				</td>	
				<td width="200px" nowrap="nowrap"> 
					<span style="display:inline-block;font-size: 11px;">ProdArea</span>
					<span style="display:inline-block;font-size: 11px;margin: 5px;">:</span>
					<html:select  name="fxCriteria" property="selectedProdArea" styleClass="DropDownTextBox" style="width:120px">
						<html:optionsCollection name="fxCriteria" property="prodAreas" value="value" label="display"/>
					</html:select>
				</td>	
				<td > 
					<a class="bosch_button_style" href="javascript:searchByFilter();">Show</a>
				</td>	
			</tr>
	</tbody>
</table>
</form>
<br/>
<div class="content">
<table id="s3list"></table>
<div id="fxPager"></div>
<div id="filter" style="margin-left: 30%; display: none">Search</div>
<script type="text/javascript">
populateFXFactor({
		colNames: [ 
		   			'<%=FXFactorConstant.MONTH%>','<%=FXFactorConstant.FXPLAN%>',
		   			'<%=FXFactorConstant.FXRW%>','<%=FXFactorConstant.FXRWH%>',
		   			'<%=FXFactorConstant.COMMENT%>','<%=FXFactorConstant.STATUS%>',
		   			'<%=FXFactorConstant.YEAR%>','<%=FXFactorConstant.PRODAREA%>',
		   			'<%=FXFactorConstant.PRIORITY%>'
		   			,''//,'',''
				  ],
		colModel: [
					{
						name : '<%=FXFactorConstant.MONTH%>',
						index : '<%=FXFactorConstant.MONTH%>',
						width : 100,
						editable:false, 
						sorttable: false
					},
					{
						name : '<%=FXFactorConstant.FXPLAN%>',
						index : '<%=FXFactorConstant.FXPLAN%>',
						width : 100,
						editable:true, 
						sorttable: false
					},
					{
						name : '<%=FXFactorConstant.FXRW%>',
						index : '<%=FXFactorConstant.FXRW%>',
						width : 100,
						editable:true, 
						sorttable: false
					},
					{
						name : '<%=FXFactorConstant.FXRWH%>',
						index : '<%=FXFactorConstant.FXRWH%>',
						width : 100,
						editable:true, 
						sorttable: false
					},
					{
						name : '<%=FXFactorConstant.COMMENT%>',
						index : '<%=FXFactorConstant.COMMENT%>',
						width : 480,
						editable:true, 
						sorttable: false,
						editoptions: { maxlength: 100 }
					},
					{
						name : '<%=FXFactorConstant.STATUS%>',
						index : '<%=FXFactorConstant.STATUS%>',
						editable:true, 
						sorttable: false,
						hidden: true
					},
					{
						name : '<%=FXFactorConstant.YEAR%>',
						index : '<%=FXFactorConstant.YEAR%>',
						editable:true, 
						sorttable: false,
						hidden: true
					},
					{
						name : '<%=FXFactorConstant.PRODAREA%>',
						index : '<%=FXFactorConstant.PRODAREA%>',
						editable:true, 
						sorttable: false,
						hidden: true
					},
					{
						name : '<%=FXFactorConstant.PRIORITY%>',
						index : '<%=FXFactorConstant.PRIORITY%>',
						editable:true, 
						sorttable: false,
						hidden: true
					}
					/*,
					{name: 'edit', width: 18, sortable: false, search: false,
	                      formatter:function(){
	                          return "<span class='ui-icon ui-icon-pencil' title='Edit'></span>";
	                      }},
	                { name: 'save', width: 20, sortable: false, search: false,
	                      formatter:function(){
	                          return "<span class='ui-icon ui-icon-document' title='Save'></span>";
	                      }}*/
	                ,
                	{ name: 'clear', width: 20, sortable: false, search: false,
                   	formatter:function(){
                       return "<span class='ui-icon ui-icon-cancel' title='Cancel'></span>";
                   	}
	                }
				]
			}
	);
</script>
</div>
